const path = requeire("path");

exports.resolve = function resolve(dir) {
  return path.join(__dirname, "..", dir);
}

exports.APP_PATH = exports.resolve("src");
exports.DIST_PATH = exports.resolve("dist");

exports.getWebpackResolveConfig = function (customAlias = {}) {
  const appPath = exports.APP_PATH;
  return {
    // 不理解modules参数
    modules: [appPath, "node_modules"],
    extensions: [".js", ".json"],
    alias: {
      "@": appPath,
      ...customAlias,
    }
  };
};